/* Markdown 内容样式 */
.markdown-content {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

.markdown-content h1 {
  font-size: 2em;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.markdown-content h2 {
  font-size: 1.5em;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

.markdown-content h3 {
  font-size: 1.25em;
}

.markdown-content h4 {
  font-size: 1em;
}

.markdown-content h5 {
  font-size: 0.875em;
}

.markdown-content h6 {
  font-size: 0.85em;
  color: var(--text-tertiary);
}

.markdown-content p {
  margin-bottom: 16px;
  line-height: 1.6;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.markdown-content li {
  margin-bottom: 4px;
  line-height: 1.6;
}

.markdown-content blockquote {
  margin: 16px 0;
  padding: 0 16px;
  color: var(--text-secondary);
  border-left: 4px solid var(--primary-color);
  background-color: var(--bg-subtle);
}

/* 行内代码样式 */
.markdown-content code {
  padding: 2px 6px;
  font-size: 1em;
  background-color: #f6f8fa;
  border-radius: 3px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: #d73a49;
  border: 1px solid #e1e4e8;
}

/* 代码块内的代码样式 - 保持透明背景 */
.markdown-content pre code {
  padding: 0;
  background-color: transparent;
  color: var(--text-primary);
  font-size: 1em;
  line-height: 1.6;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, 'Courier New', monospace;
  display: block;
  white-space: pre;
  word-wrap: normal;
  border: none;
}

/* 代码块样式 */
.markdown-content pre {
  margin: 16px 0;
  padding: 20px;
  overflow-x: auto;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* 代码块内的代码样式 */
.markdown-content pre code {
  padding: 0;
  background-color: transparent;
  color: var(--text-primary);
  font-size: 1em;
  line-height: 1.6;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, 'Courier New', monospace;
  display: block;
  white-space: pre;
  word-wrap: normal;
}

/* 代码块语言标识 */
.markdown-content pre::before {
  content: attr(data-language);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.75em;
  font-weight: 500;
  color: var(--text-tertiary);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 代码块滚动条样式 */
.markdown-content pre::-webkit-scrollbar {
  height: 6px;
}

.markdown-content pre::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.markdown-content pre::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.markdown-content pre::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* 代码高亮主题 - 类似GitHub风格 */
.markdown-content .hljs {
  background: transparent;
  color: #24292e;
}

.markdown-content .hljs-keyword {
  color: #d73a49;
  font-weight: 600;
}

.markdown-content .hljs-string {
  color: #032f62;
}

.markdown-content .hljs-comment {
  color: #6a737d;
  font-style: italic;
}

.markdown-content .hljs-function {
  color: #6f42c1;
}

.markdown-content .hljs-number {
  color: #005cc5;
}

.markdown-content .hljs-operator {
  color: #d73a49;
}

.markdown-content .hljs-punctuation {
  color: #24292e;
}

.markdown-content .hljs-class {
  color: #6f42c1;
}

.markdown-content .hljs-variable {
  color: #24292e;
}

.markdown-content .hljs-title {
  color: #6f42c1;
}

.markdown-content .hljs-params {
  color: #24292e;
}

.markdown-content .hljs-built_in {
  color: #e36209;
}

.markdown-content .hljs-literal {
  color: #005cc5;
}

.markdown-content .hljs-type {
  color: #6f42c1;
}

.markdown-content .hljs-property {
  color: #005cc5;
}

.markdown-content .hljs-meta {
  color: #6a737d;
}

.markdown-content .hljs-tag {
  color: #22863a;
}

.markdown-content .hljs-attr {
  color: #005cc5;
}

.markdown-content .hljs-name {
  color: #22863a;
}

/* 代码块悬停效果 */
.markdown-content pre:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* 代码复制按钮样式 */
.markdown-content pre {
  position: relative;
}

.markdown-content pre .copy-button {
  position: absolute;
  top: 8px;
  right: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75em;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.markdown-content pre:hover .copy-button {
  opacity: 1;
}

.markdown-content pre .copy-button:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.markdown-content table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.markdown-content th,
.markdown-content td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.markdown-content th {
  background-color: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-content tr:hover {
  background-color: var(--bg-subtle);
}

.markdown-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 8px 0;
}

.markdown-content hr {
  margin: 24px 0;
  border: none;
  border-top: 1px solid var(--border-light);
}

.markdown-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-content em {
  font-style: italic;
  color: var(--text-secondary);
}

/* 数学公式样式 */
.markdown-content .katex-display {
  margin: 16px 0;
  text-align: center;
}

.markdown-content .katex {
  font-size: 1.1em;
}

/* 代码高亮 */
.markdown-content .hljs {
  background: transparent;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .markdown-content h1 {
    font-size: 1.75em;
  }
  
  .markdown-content h2 {
    font-size: 1.375em;
  }
  
  .markdown-content h3 {
    font-size: 1.125em;
  }
  
  .markdown-content pre {
    padding: 12px;
    font-size: 0.8em;
  }
  
  .markdown-content table {
    font-size: 0.875em;
  }
  
  .markdown-content th,
  .markdown-content td {
    padding: 6px 8px;
  }
} 